package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.Weibo;
import cn.tedu._04mybatis.pojo.vo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {

    //@Insert("INSERT INTO weibo(content,created,user_id) values (#{content},#{created},#{userId})")
    int insertWeibo(Weibo weibo);

    //@Delete("DELETE FROM weibo WHERE id=#{id} ")
    int deleteWeiboByID(Long id);

    //Update("UPDATE weibo SET content=#{content},created=#{created},user_id=#{userId} WHERE id=#{id}  ")
    int updateWeiboById(Weibo weibo);

    //@Select("SELECT id,content,created,user_id userId FROM weibo WHERE id=#{id}")
    Weibo selectWeiboById(Long id);

    //@Select("SELECT id,content,created,user_id userId FROM weibo WHERE user_id=#{uid}")
    List<Weibo> selectWeiboByUserUid(Long uid);

    //@Select("SELECT content,created FROM weibo WHERE id=#{id}")
    WeiboVo1 selectWeiboCById(Long id);


    //@Select("SELECT id,content FROM weibo")
    List<WeiboCI> selectWeiboIC();

    // 动态修改
    int dynamicUpdate(Weibo weibo);

    int deleteWeiboIds1(Long[] ids);

    int deleteWeiboIds2(List<Long> ids);

    int countWeibo();

    ResultMapVO1 selectMap1(Long wid);

    ResultMapVO2 selectMap2(Long uid);

    ResultMapVO3 selectMap3(Long wid);

    ResultMapVO4 selectMap4(Long wid);

}
